import React, { Component } from "react";
import {
  HashRouter as Router,
  Routes,
  Route,
  Navigate,
} from "react-router-dom";
//登录模块
import IndexFrame from "./login_module/login_indexFrame/indexFrame";
import Register from "./login_module/register/register";
import LoginID from "./login_module/loginID/login";
import LoginPhone from "./login_module/loginPhone/login";
import ForgetPass from "./login_module/forgetPass/forgetpass";

//首页
import Home from "./homepages_module/home/home";

import List from "./homepages_module/list/list";
import ProductDetails from "./homepages_module/productDetails/productDetails";

import Special from "./homepages_module/special/special";

import Local from "./homepages_module/local/local";

import Friday from "./homepages_module/friday/friday";
import FridayDetails from "./homepages_module/fridayDetails/fridayDetails";

import Details from "./homepages_module/details/details";
import Evaluate from "./homepages_module/evaluate/evaluate";

import Integral from "./homepages_module/integral/integral";
import IntegralDetails from "./homepages_module/integralDetails/integralDetails";
import IntegralIdDetails from "./homepages_module/integralId_Details/integralId_Details";
import IntegralIdEvaluate from "./homepages_module/integralId_evaluate/integralId_evaluate";
import Search from "./homepages_module/search/search";
//个人中心
import CenterNav from "./personal_module/centerNav/centerNav";
import MyAccount from "./personal_module/myAccount/myAccount/myAccount";
import Exchange from "./personal_module/myAccount/exchange/exchange";
import Mybill from "./personal_module/myAccount/myBill/mybill";
import Recharge from "./personal_module/myAccount/recharge/recharge";
import Feedback from "./personal_module/feedback/feedback";
import ChangePass from "./personal_module/changePass/changePass";
import Browse from "./personal_module/browse/browse";
import ShoppingCollection from "./personal_module/shoppingCollection/shoppingcollection";
import Regulator from "./personal_module/site/regulator/regulator";
import Augment from "./personal_module/site/augment/augment";
import PersonalData from "./personal_module/personalData/personalData/personaldata";
import ChangePhone from "./personal_module/personalData/changePhone/changephone";
import ChangePhone2 from "./personal_module/personalData/changePhone2/changephone2";
import ChangePhone3 from "./personal_module/personalData/changePhone3/changePhone3";
import MyOrder from "./personal_module/myOrder/myOrder/myorder"; //订单导航
import AllOrder from "./personal_module/myOrder/allOrder/allorder"; //全部订单
import NotPaid from "./personal_module/myOrder/notPaid/notpaid"; //待付款
import Unsent from "./personal_module/myOrder/unsent/unsent"; //待发送
import Unreceived from "./personal_module/myOrder/unreceived/unreceived"; //未收货
import NotSay from "./personal_module/myOrder/notSay/notsay"; //待评价
import Refund from "./personal_module/myOrder/refund/refund"; //退款
import Shut from "./personal_module/myOrder/shut/shut"; //  关闭
import Gone from "./personal_module/myOrder/gone/gone"; //回收站
import Score from "./personal_module/score/score";
import ScoreOrder from "./personal_module/scoreOrder/scoreorder";
import DetNews from "./personal_module/myNews/detNews/detnews"; //消息详情
import MyNews from "./personal_module/myNews/myNews/mynews";
import SiteChange from "./personal_module/site/siteChange/sitechange";
import OrderTo from "./personal_module/myOrder/orderTo/orderto";
import OrderDetails from "./personal_module/myOrder/orderDetails/orderdetails"; //订单详情

//购物车
import EmptyCart from "./shoppingCart/emptyCart";
import AreaCart from "./shoppingCart/areaCart";
import NoAreaCart from "./shoppingCart/noAreaCart";

import SubmitSuccess from "./shoppingCart/submitSuccess";
import APay from "./shoppingCart/submitSuccess/paytype/apay";
import WeChatPay from "./shoppingCart/submitSuccess/paytype/wechatpay";
import UnionPay from "./shoppingCart/submitSuccess/paytype/yinlianpay";
import YuePay from "./shoppingCart/submitSuccess/paytype/yuepay";
import BanLancePaySuccess from "./shoppingCart/submitSuccess/banlancepaysuccess";

import ConfirmOrder from "./shoppingCart/confirmOrder";
import ConfirmOrderShop from "./shoppingCart/confirmOrderShop";
import ChangeAddress from "./shoppingCart/confirmOrder/changeAddress";
import AddAddress from "./shoppingCart/confirmOrder/addAddress";
import ConfirmOrderNoArea from "./shoppingCart/confirmOrder_noArea";

import IntegralCart from "./shoppingCart/integralCart";

import PaySuccess from "./shoppingCart/submitSuccess/paySuccess";

export default class router extends Component {
  render() {
    return (
      <Router>
        <div>
          <Routes>
            {/* 登录 */}
            <Route path="/" element={<Navigate to="/loginPhone" />}></Route>
            <Route path="/" element={<IndexFrame />}>
              <Route path="loginPhone" element={<LoginPhone />} />
              <Route path="loginID" element={<LoginID />} />
              <Route path="register" element={<Register />} />
              <Route path="forgetPass" element={<ForgetPass />} />
            </Route>
            <Route path="/home" element={<Navigate to="/home/indexList" />} />
            <Route path="/home" element={<Home />}>
              {/* 首页 */}
              <Route path="/home/indexList" element={<List />} />
              <Route path="/home/productDetails" element={<ProductDetails />}>
                <Route path="/home/productDetails" element={<Details />} />
                <Route path="/home/productDetails/evaluate" element={<Evaluate />} />
              </Route>
              <Route path="/home/special" element={<Special />} />
              <Route path="/home/local" element={<Local />} />
              {/* 星期五 */}
              <Route path="/home/friday" element={<Friday />} />
              <Route path="/home/fridayDetails" element={<FridayDetails />} >
                <Route path="/home/fridayDetails" element={<Details />} />
                <Route path="/home/fridayDetails/evaluate" element={<Evaluate />} />
              </Route>
              {/* 积分商城 */}
              <Route path="/home/integral" element={<Integral />} />
              <Route path="/home/integralDetails" element={<IntegralDetails />} >
                <Route path="/home/integralDetails" element={<IntegralIdDetails />} />
                <Route path="/home/integralDetails/evaluate" element={<IntegralIdEvaluate />} />
              </Route>
              {/* 搜索 */}
              <Route path="/home/search" element={<Search />} />


              {/* 个人中心 */}
              <Route path="/home/person" element={<Navigate to="/home/person/myaccount" />} />
              <Route path="/home/person" element={<CenterNav />}>
                <Route path="/home/person/myaccount" element={<MyAccount />} />
                <Route path="/home/person/exchange" element={<Exchange />} />
                <Route path="/home/person/mybill" element={<Mybill />} />
                <Route path="/home/person/recharge" element={<Recharge />} />

                <Route path="/home/person/feedback" element={<Feedback />} />

                <Route path="/home/person/mynews" element={<MyNews />} />

                <Route path="/home/person/browse" element={<Browse />} />

                <Route path="/home/person/shoppingcollection" element={<ShoppingCollection />} />

                <Route path="/home/person/regulator" element={<Regulator />} />
                <Route path="/home/person/augment" element={<Augment />} />

                <Route path="/home/person/personaldata" element={<PersonalData />} />
                <Route path="/home/person/changephone" element={<ChangePhone />} />
                <Route path="/home/person/changephone2" element={<ChangePhone2 />} />
                <Route path="/home/person/changephone3" element={<ChangePhone3 />} />
                <Route path="/home/person/changepass" element={<ChangePass />} />

                <Route path="/home/person/score" element={<Score />} />

                <Route path="/home/person/scoreorder" element={<ScoreOrder />} />

                <Route path="/home/person/detnews" element={<DetNews />} />

                <Route path="/home/person/sitechange" element={<SiteChange />} />

                <Route path="/home/person/orderto" element={<OrderTo />} />
                <Route path="/home/person/orderdetails" element={<OrderDetails />} />

                {/* 我的订单 */}
                <Route path="/home/person/myorder" element={<Navigate to="/home/person/myorder/allorder" />} />
                <Route path="/home/person/myorder" element={<MyOrder />}>
                  <Route path="/home/person/myorder/allorder" element={<AllOrder />} />
                  <Route path="/home/person/myorder/notpaid" element={<NotPaid />} />
                  <Route path="/home/person/myorder/unsent" element={<Unsent />} />
                  <Route path="/home/person/myorder/unreceived" element={<Unreceived />} />
                  <Route path="/home/person/myorder/notsay" element={<NotSay />} />
                  <Route path="/home/person/myorder/refund" element={<Refund />} />
                  <Route path="/home/person/myorder/shut" element={<Shut />} />
                  <Route path="/home/person/myorder/gone" element={<Gone />} />
                </Route>
              </Route>
              {/* 购物车 */}
              <Route path="/home/shoppingCart" element={<AreaCart />} />
              <Route path="/home/noareaCart" element={<NoAreaCart />} />
              <Route path="/home/emptyCart" element={<EmptyCart />} />
              <Route path="/home/submitsuccess" element={<Navigate to="/home/submitsuccess/apay" />} />
              <Route path="/home/submitsuccess" element={<SubmitSuccess />}>
                <Route path="/home/submitsuccess/apay" element={<APay />} />
                <Route path="/home/submitsuccess/wechatpay" element={<WeChatPay />} />
                <Route path="/home/submitsuccess/yinlianpay" element={<UnionPay />} />
                <Route path="/home/submitsuccess/yuepay" element={<YuePay />} />
                <Route path="/home/submitsuccess/banlancepaysuccess" element={<BanLancePaySuccess />} />
              </Route>
              <Route path="/home/confirmOrder" element={<ConfirmOrder />} />
              <Route path="/home/confirmOrder/changeAddress" element={<ChangeAddress />} />
              <Route path="/home/confirmOrderShop" element={<ConfirmOrderShop />} />
              <Route path="/home/confirmOrder/addAddress" element={<AddAddress />} />
              <Route path="/home/confirmOrderNoArea" element={<ConfirmOrderNoArea />} />
              <Route path="/home/paysuccess" element={<PaySuccess />} />
              <Route path="/home/integralcart" element={<IntegralCart />} />
            </Route>
          </Routes>
        </div>
      </Router>
    );
  }
}
